package com.collection;

import java.util.Objects;

/**
 * @Author WaveHi
 * @Date 13/8/2021 上午 11:59
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 * @Description 
 */
public class Student extends Person implements Comparable{

    private int sId;//学号

    public Student() {
    }

    public Student(String name, int age, int sId) {
        super(name, age);
        this.sId = sId;
    }

    public int getsId() {
        return sId;
    }

    public void setsId(int sId) {
        this.sId = sId;
    }

    @Override
    public String toString() {
        return "Student{" +
                "sId=" + sId +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        Student student = (Student) o;
        return sId == student.sId;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), sId);
    }

    @Override
    public int compareTo(Object o) {
        return 0;
    }
}
